﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;

namespace MainGame
{
    public static class SoundManager
    {
        private static bool Initialized = false;
        public static SoundEffect Background;

        public static SoundEffect Giant_Attack { get; set; }
        public static SoundEffect Giant_Die { get; set; }
        public static SoundEffect Giant_BeAttacked { get; set; }

        public static SoundEffect Beetle_Attack { get; set; }
        public static SoundEffect Beetle_Die { get; set; }
        public static SoundEffect Beetle_BeAttacked { get; set; }

        public static SoundEffect Dino_Attack { get; set; }
        public static SoundEffect Dino_Die{ get; set; }
        public static SoundEffect Dino_BeAttacked{ get; set; }

        public static SoundEffect Butcher_Attack { get; set; }
        public static SoundEffect Butcher_Die { get; set; }
        public static SoundEffect Butcher_BeAttacked { get; set; }


        public static SoundEffect Hero_Attack { get; set; }
        public static SoundEffect Hero_Die { get; set; }
        public static SoundEffect Hero_BeAttacked { get; set; }

        public static SoundEffect Explosive { get; set; }

        public static void LoadContent(ContentManager  Content)
        {
            if (!SoundManager.Initialized)
            {
                Background = Content.Load<SoundEffect>("Sounds/Background");

                Giant_Attack = Content.Load<SoundEffect>("Sounds/Giant/Attack");
                Giant_Die = Content.Load<SoundEffect>("Sounds/Giant/Die");
                Giant_BeAttacked = Content.Load<SoundEffect>("Sounds/Giant/BeAttacked");

                Beetle_Attack = Content.Load<SoundEffect>("Sounds/Beetle/Attack");
                Beetle_Die = Content.Load<SoundEffect>("Sounds/Beetle/Die");
                Beetle_BeAttacked = Content.Load<SoundEffect>("Sounds/Beetle/BeAttacked");

                Dino_Attack = Content.Load<SoundEffect>("Sounds/Dino/Attack");
                Dino_Die = Content.Load<SoundEffect>("Sounds/Dino/Die");
                Dino_BeAttacked = Content.Load<SoundEffect>("Sounds/Dino/BeAttacked");

                Butcher_Attack = Content.Load<SoundEffect>("Sounds/Butcher/Attack");
                Butcher_Die = Content.Load<SoundEffect>("Sounds/Butcher/Die");
                Butcher_BeAttacked = Content.Load<SoundEffect>("Sounds/Butcher/BeAttacked");

                Hero_Attack = Content.Load<SoundEffect>("Sounds/Hero/Attack");
                Hero_Die = Content.Load<SoundEffect>("Sounds/Hero/Die");
                Hero_BeAttacked = Content.Load<SoundEffect>("Sounds/Hero/BeAttacked");

                Explosive = Content.Load<SoundEffect>("Sounds/Explosive/explode");
            }
            SoundManager.Initialized = true;
        }
        public static void UnLoadContent()
        {
            if (SoundManager.Initialized)
            {
                Background.Dispose();

                Giant_Attack.Dispose();
                Giant_BeAttacked.Dispose();
                Giant_Die.Dispose();

                Beetle_Attack.Dispose();
                Beetle_BeAttacked.Dispose();
                Beetle_Die.Dispose();

                Dino_Attack.Dispose();
                Dino_BeAttacked.Dispose();
                Dino_Die.Dispose();

                Butcher_Attack.Dispose();
                Butcher_BeAttacked.Dispose();
                Butcher_Die.Dispose();
                
            }
            SoundManager.Initialized = false;
        }
    }
}
